/*
 * Copyright (c) 2016- 2020 qolome.com Inc. All Rights Reserved.
 * ProjectName: qolome-knowledge
 * FileName: ConcretePrototype.java
 * Author: jiangfeng@qolome.com
 * Date: 2020/3/1 下午3:54
 * LastModified: 2020/03/01 15:36:01
 */

package com.qolome.knowledge.design.pattern.prototype.shallow;


import com.qolome.knowledge.design.pattern.prototype.IPrototype;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Qolome
 * @version V1.0
 * @Description 克隆
 * @date 2020年 03月01日 15:32:08
 */

@Data
public class ConcretePrototype implements Cloneable {

    private int age;
    private String name;
    List<String> hobbies;

    @Override
    public ConcretePrototype clone() {
        try {
            return (ConcretePrototype) super.clone();
        }catch (CloneNotSupportedException e){
            e.printStackTrace();
            return null;
        }
    }
}
